<template>
    <div>
      <h2>新增公告</h2>
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>通知信息</span>
        </div>
        <div>
          <el-form ref="form" :model="announcement" label-width="80px">
            <el-form-item label="消息标题">
              <el-input v-model="announcement.title"></el-input>
            </el-form-item>
            <el-form-item label="消息内容">
              <el-input v-model="announcement.content" type="textarea"></el-input>
            </el-form-item>
            <el-form-item label="发布时间">
              <el-date-picker
                  v-model="announcement.releaseTime"
                  type="date"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="接收人">
              <el-link type="primary" @click="selectContactPersonFlag()">+选择联系人</el-link>
            </el-form-item>
            <el-button type="primary" @click="addAnnouncement()">发布</el-button>
            <el-button @click="returnGonggao()">返回</el-button>
          </el-form>
        </div>
      </el-card>
      <el-dialog title="选择接收医生" :visible.sync="dialogTableVisibleFlag">
        <el-table :data="gridData">
          <el-table-column property="date" label="日期" width="150"></el-table-column>
          <el-table-column property="name" label="姓名" width="200"></el-table-column>
          <el-table-column property="address" label="地址"></el-table-column>
        </el-table>
      </el-dialog>
    </div>
</template>

<script>
import axios from "axios";

export default {
  name: "addAndDelete",
  data() {
    return {
      announcement:{},
      dialogTableVisibleFlag:false,
      gridData:[]
    }
  },
  created() {
  },
  methods:{
    returnGonggao(){
      this.$router.push({path:'/xitong/gonggao'})
    },
    addAnnouncement(){
      axios.post("http://localhost:8088/announcement/",this.announcement).then(res=>{
        this.$router.push({path:'/xitong/gonggao'})
      })
    },
    selectContactPersonFlag(){

    }
  }
}
</script>

<style scoped>

</style>